# coding=utf-8
import requests
from pyquery import PyQuery as pq

#安装插件
# pip3.7 install requests
# pip3.7 install PyQuery

# 登录地址
login_url = "https://www.yiichina.com/login"


# 构造登陆的header头
headers = {
    'Accept': "*/*",
    'Accept-Encoding': "gzip, deflate",
    'Accept-Language': "zh-CN,zh;q=0.9",
    'Connection': "keep-alive",
    'Content-Length': "37",
    'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8",
    'Host': "21102.cn:8888",
    'Origin': "http://21102.cn:8888",
    'Referer': "http://21102.cn:8888/login",
    'Cookie': "UM_distinctid=16a8bc250b6198-0b49ab27ca8f2a-6353160-1fa400-16a8bc250b743f; pgv_pvi=9278958592; serverType=nginx; memRealUsed=606; mem-before=606/992%20%28MB%29; memSize=992; order=id%20desc; conterError=; upNet=1.54; downNet=0.2; one=0.08; five=0.03; fifteen=0.05; BT_PANEL=7b625315fcfbf8382c9e8f9ddbd882a427f993f4",
    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"
}

# 登陆方法和签到
def login_sign():
    r_session = requests.Session()

    data = {
        "username": "dark",#帐号
        "password": "houqiang",#密码
    }
    # 完成用户登录
    response1 = r_session.post(login_url, data=data, headers=headers)

    print(response1)

if __name__ == "__main__":
    login_sign()
